﻿using System;
using System.Collections.Generic;
using System.Web;
using System.IO;
using System.Data;
using System.Xml;

public class PageBase : System.Web.UI.Page
{

    #region Members

    protected Ko2.Portal.Env _env = new Ko2.Portal.Env();
    string strYear, strMonth, strDay;
    string strHour, strMinute, strSecond;
    string strIntID;
    int _Year, _Month, _Day;
    int _Hour, _Minute, _Second;
    int _intID;
    public int Year
    {
        get { return _Year; }
    }
    public int Month
    {
        get { return _Month; }
    }
    public int Day
    {
        get { return _Day; }
    }
    public int Hour
    {
        get { return _Hour; }
    }
    public int Minute
    {
        get { return _Minute; }
    }
    public int Second
    {
        get { return _Second; }
    }
    public int intID
    {
        get { return _intID; }
    }

    #endregion

    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);
        // Enabled trace in code
        // this.Context.Trace.IsEnabled = false;
        InitMembers();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    private void InitMembers()
    {
        DateTime dtNow = DateTime.Now;

        if (Request.Params["Year"] != null)
            strYear = Request.Params["Year"].ToString();
        else if (Request.Params["year"] != null)
            strYear = Request.Params["year"].ToString();
        else
            strYear = dtNow.Year.ToString();

        if (Request.Params["Month"] != null)
            strMonth = Request.Params["Month"].ToString();
        else if (Request.Params["month"] != null)
            strMonth = Request.Params["month"].ToString();
        else
            strMonth = dtNow.Month.ToString();

        if (Request.Params["Day"] != null)
            strDay = Request.Params["Day"].ToString();
        else if (Request.Params["day"] != null)
            strDay = Request.Params["day"].ToString();
        else
            strDay = dtNow.Day.ToString();

        if (Request.Params["Hour"] != null)
            strHour = Request.Params["Hour"].ToString();
        else if (Request.Params["hour"] != null)
            strHour = Request.Params["hour"].ToString();
        else
            strHour = "0";

        if (Request.Params["Minute"] != null)
            strMinute = Request.Params["Minute"].ToString();
        else if (Request.Params["minute"] != null)
            strMinute = Request.Params["minute"].ToString();
        else
            strMinute = "0";

        if (Request.Params["Second"] != null)
            strSecond = Request.Params["Second"].ToString();
        else if (Request.Params["second"] != null)
            strSecond = Request.Params["second"].ToString();
        else
            strSecond = "1";

        if (Request.Params["intid"] != null)
            strIntID = Request.Params["intid"].ToString();
        else if (Request.Params["intId"] != null)
            strIntID = Request.Params["intId"].ToString();
        else if (Request.Params["intID"] != null)
            strIntID = Request.Params["intID"].ToString();
        else if (Request.Params["INTID"] != null)
            strIntID = Request.Params["INTID"].ToString();
        else
            strIntID = "-1";

        _Year = Convert.ToInt32(strYear);
        _Month = Convert.ToInt32(strMonth);
        _Day = Convert.ToInt32(strDay);
        _Hour = Convert.ToInt32(strHour);
        _Minute = Convert.ToInt32(strMinute);
        _Second = Convert.ToInt32(strSecond);

        _intID = Convert.ToInt32(strIntID);

    }

}
